package cn.school.controller;


import cn.school.dto.*;
import cn.school.service.PaperSubmissionService;
import cn.school.vo.ResultVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/paperDetail")
public class PaperSubmissionController {
    @Resource
    private PaperSubmissionService paperSubmissionService;
    @RequestMapping("addPaperSubmission")
    public String addPaperSubmission(@RequestBody PaperSubmissionDto paperSubmissionDto, HttpServletRequest request){
        String message = paperSubmissionService.addPaperSubmission(paperSubmissionDto,request);
        return message;
    }
    @RequestMapping("setScore")
    public String setScore(@RequestBody PaperSetScoreDto paperSetScoreDto, HttpServletRequest request){
        String message = paperSubmissionService.setScore(paperSetScoreDto,request);
        return message;
    }
    @RequestMapping("delScore")
    public String delScore(@RequestBody DelScoreDto delScoreDto, HttpServletRequest request){
        String message = paperSubmissionService.delScore(delScoreDto,request);
        return message;
    }
    @RequestMapping("findPaperSubmissionList")
    public ResultVo findPaperSubmissionList(HttpServletRequest request, @RequestBody FindPaperSubmissionListDto findPaperSubmissionListDto){
        ResultVo resultVo = paperSubmissionService.findPaperSubmissionList(request,findPaperSubmissionListDto);
        return resultVo;
    }
    @RequestMapping("findPaperSubmission")
    public ResultVo findPaperSubmission(HttpServletRequest request, @RequestBody FindPaperSubmissionDto findPaperSubmissionDto){
        ResultVo resultVo = paperSubmissionService.findPaperSubmission(request,findPaperSubmissionDto);
        return resultVo;
    }
}
